﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Kooboo.Globalization;
using System.Globalization;
using System.Web.Mvc;

namespace Kooboo.Web.Areas.Commerce
{
    public class CultureHelper
    {

        public static IEnumerable<SelectListItem> BuildCultures(string selectedCulture)
        {
            if (selectedCulture == null)
            {
                selectedCulture = "";
            }
            else
            {
                selectedCulture = selectedCulture.Trim();
            }
            foreach (var i in CultureInfo.GetCultures(CultureTypes.AllCultures).OrderBy(i => i.DisplayName))
            {
                yield return new SelectListItem { Text = i.DisplayName, Value = i.Name, Selected = i.Name == selectedCulture };
            }
        }

     
       
    }
}